﻿using System.Collections.Generic;
using MediaLibraryManagement.DAL;
using MediaLibraryManagement.Entity;

namespace MediaLibraryManagement.BLL
{
    public class UserBLL
    {
        private UserDAL _dataAccess;

        public UserBLL()
        {
            _dataAccess = new UserDAL();
        }

        public User GetUserByID(int id)
        {
            return (User)_dataAccess.GetByID(id);
        }

        public User GetUserByUserName(string userName)
        {
            return _dataAccess.GetUserByUserName(userName);
        }

        public void Insert(User user)
        {
            _dataAccess.Insert(user);
        }

        public void Update(User user)
        {
            _dataAccess.Update(user);
        }

        public List<User> Search(string username)
        {
            return _dataAccess.Search(username);
        }
    }
}